package com.leyou.common.annotation;

import com.leyou.common.advice.CommonLogAdvice;
import com.leyou.common.advice.ControllerExceptionAdvice;
import org.springframework.context.annotation.Import;
import org.springframework.web.bind.annotation.ControllerAdvice;

import java.lang.annotation.*;

/**
 * 自定义注解，用于处理异常 可以使用此注解加载需要异常处理的类上
 * @Import(ControllerAdvice.class) //导入定义的异常处理类
 */
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@Import({ControllerExceptionAdvice.class, CommonLogAdvice.class}) //导入定义的异常处理类和日志记录
public @interface EnableExceptionAdvice {
}
